package mapper;


import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.log4j.Logger;
import org.beetl.sql.core.annotatoin.Sql;
import org.beetl.sql.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import entity.SysRoleFunc;



@Mapper 
@Repository
public interface SysRoleFuncRepository extends BaseMapper<SysRoleFunc> {
	
	public static Logger logger = Logger.getLogger(SysRoleFuncRepository.class);  
	public int getCount();

	@Sql(value=" select * from sysconsole.sys_role_func",returnType=SysRoleFunc.class)
	public List<SysRoleFunc> allSysUsers();
	
	@Sql(value=" select * from sysconsole.sys_role_func where seqid = ?",returnType=SysRoleFunc.class)
	public SysRoleFunc findById(long seqid);
	
	@Sql(value=" delete from sysconsole.sys_role_func where seqid = ?")
	public void deleteForId(long seqid);
	
	@Sql(value=" select * from sysconsole.sys_role_func where name = ?",returnType=SysRoleFunc.class)
	public SysRoleFunc findRoleByName(String name);
	
	@Sql(value=" select * from sysconsole.sys_role_func where role_id = ?",returnType=SysRoleFunc.class)
	public List<SysRoleFunc> sysRoleFuncByRoleId(long roleId);
	
	@Sql(value=" select * from sysconsole.sys_role_func where role_id = ? and func_id = ?",returnType=SysRoleFunc.class)
	public SysRoleFunc sysRoleFuncByRoleIdAndFuncId(long roleId,long funcId);

}
